﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TinyERP.Framework.Plugin;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
using TinyERP.Framework;
using TinyERP.Core.DAO;
using TinyERP.Core.Business;

namespace TinyERP.Core
{
    public class PluginContextImp : PluginContext
    {
        public override void RegisterModuleObjects()
        {
            RegisterDALObject(typeof(UserDAO));
            RegisterServiceObject(typeof(UserService), new string[] { typeof(UserDAO).Name });

            RegisterDALObject(typeof(UserGroupDAO));
            RegisterServiceObject(typeof(UserGroupService), new string[] { typeof(UserGroupDAO).Name,
            typeof(GroupACLDAO).Name,
            typeof(UINodeDAO).Name,
            typeof(GroupACLService).Name});

            RegisterDALObject(typeof(DepartmentDAO));
            RegisterServiceObject(typeof(DepartmentService), new string[] { typeof(DepartmentDAO).Name });

            RegisterDALObject(typeof(UINodeDAO));
            RegisterServiceObject(typeof(UINodeService), new string[] { typeof(UINodeDAO).Name,
            typeof(GroupACLDAO).Name});

            RegisterDALObject(typeof(ModuleDAO));
            RegisterServiceObject(typeof(ModuleService), new string[] { 
                typeof(ModuleDAO).Name, 
                typeof(UINodeDAO).Name,
                typeof(UserGroupDAO).Name,
                typeof(GroupACLDAO).Name});

            RegisterServiceObject(typeof(ModuleRegisterService), new string[] { 
                typeof(ModuleDAO).Name, 
                typeof(UINodeDAO).Name,
                typeof(UserGroupDAO).Name,
                typeof(GroupACLDAO).Name});


            RegisterDALObject(typeof(GroupACLDAO));
            RegisterServiceObject(typeof(GroupACLService), new string[] { typeof(GroupACLDAO).Name,
             typeof(UINodeDAO).Name});

        }
    }
}
